import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/admin/login',
    method: 'post',
    data
  })
}

export function getInfo() {
  return request({
    url: '/info',
    method: 'get'
  })
}

export function logout() {
  return request({
    url: '/logout',
    method: 'post'
  })
}

export function memberLogin(data) {
  return request({
    url: '/member/login',
    method: 'POST',
    data
  })
}
// 注册
export function register(data) {
  return request({
    url: '/user',
    method: 'POST',
    data
  })
}
// 用户列表
export function getUserList(data) {
  return request({
    url: '/user',
    method: 'GET',
    params: data
  })
}
// 用户编辑
export function updateUser(data) {
  return request({
    url: '/user',
    method: 'PUT',
    data
  })
}
// 用户删除
export function deleteUser(data) {
  return request({
    url: '/user/batch',
    method: 'DELETE',
    params: {
      ids: data
    }
  })
}
